this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.UI=this.BX.Landing.UI||{};(function(e,t,i,n,a,r){"use strict";var s,o,c,d,l;var v=function(e){babelHelpers.inherits(i,e);function i(e){var n;babelHelpers.classCallCheck(this,i);n=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(i).call(this,e));n.setEventNamespace("BX.Landing.UI.Card.IconListCard");n.title="";n.items=new Map;n.activeIcon=null;n.previewOptionsCard=new r.IconOptionsCard;n.previewOptionsCard.subscribe("onChange",n.onPreviewOptionClick.bind(babelHelpers.assertThisInitialized(n)));t.Dom.append(n.previewOptionsCard.getLayout(),n.getPreviewOptions());return n}babelHelpers.createClass(i,[{key:"getLayout",value:function e(){var i=this;return this.cache.remember("layout",(function(){return t.Tag.render(s||(s=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-ui-card landing-ui-card-icons">\n\t\t\t\t\t<div class="landing-ui-card-header-wrapper">\n\t\t\t\t\t\t',"\n\t\t\t\t\t\t",'\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="landing-ui-card-body-wrapper">\n\t\t\t\t\t\t',"\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t"])),i.getHeader(),i.getPreview(),i.getBody())}))}},{key:"getPreview",value:function e(){return this.cache.remember("preview",(function(){return t.Tag.render(o||(o=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-ui-card-preview --hide">\n\t\t\t\t\t<div class="landing-ui-card-preview-icon"></div>\n\t\t\t\t\t<div class="landing-ui-card-preview-options"></div>\n\t\t\t\t</div>\n\t\t\t'])))}))}},{key:"getPreviewIcon",value:function e(){return this.getPreview().querySelector(".landing-ui-card-preview-icon")}},{key:"getPreviewOptions",value:function e(){return this.getPreview().querySelector(".landing-ui-card-preview-options")}},{key:"setPreviewIcon",value:function e(i){var n=t.Tag.render(c||(c=babelHelpers.taggedTemplateLiteral(['<span class="','"></span>'])),i);t.Dom.clean(this.getPreviewIcon());t.Dom.append(n,this.getPreviewIcon())}},{key:"addItem",value:function e(i,n){var a=this;if(this.getBody().childElementCount===0){this.itemsContainer=t.Tag.render(d||(d=babelHelpers.taggedTemplateLiteral(['<div class="landing-ui-card-icons-container"></div>'])));t.Dom.append(this.itemsContainer,this.getBody())}var r=t.Tag.render(l||(l=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="landing-ui-card landing-ui-card-icon">\n\t\t\t\t<span class="','"></span>\n\t\t\t</div>\n\t\t'])),i);t.Event.bind(r,"click",this.onItemClick.bind(this,r,n));t.Dom.append(r,this.itemsContainer);var s=getComputedStyle(r.querySelector("span"),":before");requestAnimationFrame((function(){var e=s.getPropertyValue("content");if(e==="none"){console.warn('Attention, item "'+i+'" has no content')}if(a.items.has(e)){r.hidden=true}else{a.items.set(e,true)}}))}},{key:"onItemClick",value:function e(i,n){var a=this.getBody().querySelector(".landing-ui-card-icon.--active");if(a){t.Dom.removeClass(a,"--active")}t.Dom.addClass(i,"--active");this.activeIcon=i.firstElementChild.className;if(t.Type.isObject(n)){this.setPreviewIcon(n.defaultOption);this.previewOptionsCard.setOptions(n.options,n.defaultOption)}else{this.setPreviewIcon(this.activeIcon);this.previewOptionsCard.setOptions([this.activeIcon],this.activeIcon)}t.Dom.removeClass(this.getPreview(),"--hide")}},{key:"onPreviewOptionClick",value:function e(t){var i=t.getData().option;this.activeIcon=i;this.setPreviewIcon(i)}},{key:"getActiveIcon",value:function e(){return this.activeIcon}},{key:"getActiveOptions",value:function e(){return this.previewOptionsCard.getOptions()}}]);return i}(a.BaseCard);e.IconListCard=v})(this.BX.Landing.UI.Card=this.BX.Landing.UI.Card||{},BX,BX.Event,BX.Landing,BX.Landing.UI.Card,BX.Landing.UI.Card);
//# sourceMappingURL=iconlistcard.bundle.map.js